﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASCalpuff.FileLayers
{
    public class MG6:Group
    {

        /// <summary>
        /// 混合层高度经验参数 EMPIRICAL MIXING HEIGHT CONSTANTS
        /// </summary>
        CMetMixingHeight m_MixingHeight;

        public CMetMixingHeight MixingHeight
        {
            get { return m_MixingHeight; }
            set { m_MixingHeight = value; }
        }

        /// <summary>
        /// 海平面通量计算方法和参数OVERWATER SURFACE FLUXES METHOD and PARAMETERS
        /// </summary>
        CMetCoare m_Coare;

        public CMetCoare Coare
        {
            get { return m_Coare; }
            set { m_Coare = value; }
        }
        /// <summary>
        /// 相对湿度参数、温度参数和降雨内插参数
        /// </summary>
        CMetTemperatureRH m_TemperatureRH;
        public CMetTemperatureRH TemperatureRH
        {
            get { return m_TemperatureRH; }
            set { m_TemperatureRH = value; }
        }


        public  string WriteToGroup()
        {
            string ResultStr = "", TempStr;
            string END = "\r\n";

            TempStr = "INPUT GROUP: 6 -- Mixing Height, Temperature and Precipitation Parameters" + END;
            ResultStr += TempStr;

            TempStr = MixingHeight.WriteToString();
            ResultStr += TempStr;

            TempStr = Coare.WriteToString();
            ResultStr += TempStr;

            TempStr = TemperatureRH.WriteToString();
            ResultStr += TempStr;

            TempStr = "! END !" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetCLine();
            ResultStr += TempStr;

            return ResultStr;



            //return base.WriteToGroup();

        }

        public override void ReadFromGroup(Dictionary<string, string> dic)
        {
            this.MixingHeight.ReadFromGroup(dic);
            this.Coare.ReadFromGroup(dic);
            this.TemperatureRH.ReadFromGroup(dic);
        }

    }

    public class CMetMixingHeight : ICloneable
    {





        // Fields
        //混合层高度经验参数 EMPIRICAL MIXING HEIGHT CONSTANTS

        /// <summary>
        /// 中性机械层经验常数
        /// </summary>
        private double m_CONSTB = 1.41;
        /// <summary>
        /// 对流混合层经验常数
        /// </summary>
        private double m_CONSTE = 0.15;
        /// <summary>
        /// 稳定混合层经验常数
        /// </summary>
        private double m_CONSTN = 2400.0;
        /// <summary>
        /// 海面混合层经验常数
        /// </summary>
        private double m_CONSTW = 0.16;

        /// <summary>
        /// 克里奥地利参数， 单位(1/s)
        /// </summary>
        private double m_FCORIOL = 0.0001;
        //混合层高度的空间平均
        /// <summary>
        /// 是否进行空间平均,(0=no, 1=yes)
        /// </summary>
        private int m_IAVEZI = 1;

        public int IAVEZI
        {
            get { return m_IAVEZI; }
            set { m_IAVEZI = value; }
        }
        /// <summary>
        /// //空间平均过程中的最大搜索距离（在网格单元内）平均的方形区域单元长度为2X，单位是grid cells
        /// </summary>
        private int m_MNMDAV = 10;

        /// <summary>
        /// 空间平均的逆风圆锥半角，单位deg
        /// </summary>
        private double m_HAFANG = 30.0;

        /// <summary>
        /// 使用混合层的逆风平均的风场层（必须是第一到NZ层）
        /// </summary>
        private int m_ILEVZI = 1;


        //对流混合层高度选项

        /// <summary>
        /// 计算对流混合层高度的方法
        /// 1: Maul-Carson for land and water cells
        /// -1: Maul-Carson for land cells only -  OCD mixing height overwater
        /// 2: Batchvarova and Gryning for land and water cells
        /// -2: Batchvarova and Gryning for land cells only              OCD mixing height overwater
        /// </summary>
        private int m_IMIXH = 1;



        /// <summary>
        /// 陆面上支持对流混合层高度增长的浮力通量阈值， units: W/m3
        /// </summary>
        private double m_THRESHL = 0.05;

        /// <summary>
        /// 海面上支持对流混合层高度增长的浮力通量阈值， units: W/m3
        /// </summary>

        private double m_THRESHW = 0.05;

        public double THRESHW
        {
            get { return this.m_THRESHW; }
            set { this.m_THRESHW = value; }
        }

        //  Option for overwater lapse rates used


        /// <summary>
        /// 海面上温度递减率运用在计算对流混合层高度增长的选项
        /// 0 : 使用 SEA.DAT的递减率 and deltaT (或者假定中性条件)
        /// 1 : 使用预测的温度递减率 (only if IPROG>2)和SEA.DAT deltaT (or neutral if missing)
        /// 2 : use prognostic lapse rates and prognostic delta T    (only if iprog>12 and 3D.DAT version# 2.0 or higher)
        /// </summary>
        private int m_ITWPROG = 0;



        /// <summary>
        /// 3d.dat中海洋用地类型的分类号
        /// </summary>
        private int m_ILUOC3D = 16;

        // OTHER MIXING HEIGHT VARIABLES其他混合层高度参数

        /// <summary>
        /// 对流混合层高度以上最大的位势温度递减率，单位:deg. K/m
        /// </summary>
        private double m_DPTMIN = 0.001;



        /// <summary>
        /// 对流混合层高度上的高度，单位：m
        /// </summary>
        private double m_DZZI = 200.0;
        /// <summary>
        /// 陆面上最小混合层高度，单位：m
        /// </summary>
        private double m_ZIMIN = 50.0;
        /// <summary>
        /// 陆面上最大混合层高度，单位：m
        /// </summary>
        private double m_ZIMAX = 5000.0;

        /// <summary>
        /// 海面上最小混合层高度，单位：m
        /// 如果使用观测的海面混合层高度，那么此选项无效
        /// </summary>
        private double m_ZIMINW = 50.0;
        /// <summary>
        /// 海面上最大混合层高度，单位：m
        /// 如果使用观测的海面混合层高度，那么此选项无效
        /// </summary>
        private double m_ZIMAXW = 5000.0;





        // Methods
        public object Clone()
        {
            return null;
        }

        // Properties for mixing height

        #region Properties
        public double CONSTB
        {
            get
            {
                return this.m_CONSTB;
            }
            set
            {
                this.m_CONSTB = value;
            }
        }

        public double CONSTE
        {
            get
            {
                return this.m_CONSTE;
            }
            set
            {
                this.m_CONSTE = value;
            }
        }

        public double CONSTN
        {
            get
            {
                return this.m_CONSTN;
            }
            set
            {
                this.m_CONSTN = value;
            }
        }

        public double CONSTW
        {
            get
            {
                return this.m_CONSTW;
            }
            set
            {
                this.m_CONSTW = value;
            }
        }



        public double DPTMIN
        {
            get
            {
                return this.m_DPTMIN;
            }
            set
            {
                this.m_DPTMIN = value;
            }
        }



        public double DZZI
        {
            get
            {
                return this.m_DZZI;
            }
            set
            {
                this.m_DZZI = value;
            }
        }

        public double FCORIOL
        {
            get
            {
                return this.m_FCORIOL;
            }
            set
            {
                this.m_FCORIOL = value;
            }
        }

        public double HAFANG
        {
            get
            {
                return this.m_HAFANG;
            }
            set
            {
                this.m_HAFANG = value;
            }
        }






        public int ILEVZI
        {
            get
            {
                return this.m_ILEVZI;
            }
            set
            {
                this.m_ILEVZI = value;
            }
        }

        public int ILUOC3D
        {
            get
            {
                return this.m_ILUOC3D;
            }
            set
            {
                this.m_ILUOC3D = value;
            }
        }

        public int IMIXH
        {
            get
            {
                return this.m_IMIXH;
            }
            set
            {
                this.m_IMIXH = value;
            }
        }




        public int ITWPROG
        {
            get
            {
                return this.m_ITWPROG;
            }
            set
            {
                this.m_ITWPROG = value;
            }
        }





        public int MNMDAV
        {
            get
            {
                return this.m_MNMDAV;
            }
            set
            {
                this.m_MNMDAV = value;
            }
        }









        public double THRESHL
        {
            get
            {
                return this.m_THRESHL;
            }
            set
            {
                this.m_THRESHL = value;
            }
        }





        public double ZIMAX
        {
            get
            {
                return this.m_ZIMAX;
            }
            set
            {
                this.m_ZIMAX = value;
            }
        }

        public double ZIMAXW
        {
            get
            {
                return this.m_ZIMAXW;
            }
            set
            {
                this.m_ZIMAXW = value;
            }
        }

        public double ZIMIN
        {
            get
            {
                return this.m_ZIMIN;
            }
            set
            {
                this.m_ZIMIN = value;
            }
        }

        public double ZIMINW
        {
            get
            {
                return this.m_ZIMINW;
            }
            set
            {
                this.m_ZIMINW = value;
            }
        }


        #endregion



        #region IFileFrag 成员

        public string WriteToString()
        {
            string ResultStr = "", TempStr;
            string END = "\r\n";

            TempStr = "EMPIRICAL MIXING HEIGHT CONSTANTS" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("CONSTB", CONSTB.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("CONSTE", CONSTE.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("CONSTN", CONSTN.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("CONSTW", CONSTW.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("FCORIOL", FCORIOL.ToString());
            ResultStr += TempStr;

            TempStr = "SPATIAL AVERAGING OF MIXING HEIGHTS" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("IAVEZI", IAVEZI.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("MNMDAV", MNMDAV.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("HAFANG", HAFANG.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ILEVZI", ILEVZI.ToString());
            ResultStr += TempStr;

            TempStr = "CONVECTIVE MIXING HEIGHT OPTIONS:" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("IMIXH", IMIXH.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("THRESHL", THRESHL.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("THRESHW", THRESHW.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ITWPROG", ITWPROG.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ILUOC3D", ILUOC3D.ToString());
            ResultStr += TempStr;

            TempStr = "OTHER MIXING HEIGHT VARIABLES" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("DPTMIN", DPTMIN.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("DZZI", DZZI.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ZIMIN", ZIMIN.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ZIMAX", ZIMAX.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ZIMINW", ZIMINW.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ZIMAXW", ZIMAXW.ToString());
            ResultStr += TempStr;

            return ResultStr;

            //throw new NotImplementedException();
        }

        public void ReadFromDic(ref Dictionary<string, string> dic)
        {
            throw new NotImplementedException();
        }

        #endregion
        public void ReadFromGroup(Dictionary<string, string> dic)
        {
            foreach (KeyValuePair<string, string> m_dic in dic)
            {
                if (m_dic.Key == "IAVEZI")
                {
                    this.IAVEZI = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "CONSTB")
                {
                    this.CONSTB = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "CONSTE")
                {
                    this.CONSTE = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "CONSTN")
                {
                    this.CONSTN = Convert.ToDouble(m_dic.Value);
                }

                if (m_dic.Key == "CONSTW")
                {
                    this.CONSTW = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "DPTMIN")
                {
                    this.DPTMIN = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "DZZI")
                {
                    this.DZZI = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "FCORIOL")
                {
                    this.FCORIOL = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "HAFANG")
                {
                    this.HAFANG = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "THRESHW")
                {
                    this.THRESHW = Convert.ToDouble(m_dic.Value);
                }
                //
                if (m_dic.Key == "ILEVZI")
                {
                    this.ILEVZI = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "ILUOC3D")
                {
                    this.ILUOC3D = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "IMIXH")
                {
                    this.IMIXH = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "ITWPROG")
                {
                    this.ITWPROG = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "MNMDAV")
                {
                    this.MNMDAV = Convert.ToInt32(m_dic.Value);
                }

                if (m_dic.Key == "THRESHL")
                {
                    this.THRESHL = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "ZIMAX")
                {
                    this.ZIMAX = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "ZIMAXW")
                {
                    this.ZIMAXW = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "ZIMIN")
                {
                    this.ZIMIN = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "ZIMINW")
                {
                    this.ZIMINW = Convert.ToDouble(m_dic.Value);
                }

            }
        }
    }

    public class CMetCoare
    {



        //(ICOARE)                           Default: 10      ! ICOARE =  10   !
        //   0: original deltaT method (OCD)
        //  10: COARE with no wave parameterization (jwave=0, Charnock)
        //  11: COARE with wave option jwave=1 (Oost et al.)
        //      and default wave properties
        // -11: COARE with wave option jwave=1 (Oost et al.)
        //      and observed wave properties (must be in SEA.DAT files)
        //  12: COARE with wave option 2 (Taylor and Yelland)
        //       and default wave properties
        // -12: COARE with wave option 2 (Taylor and Yelland)
        //      and observed wave properties (must be in SEA.DAT files)

        //  Note:  When ICOARE=0, similarity wind profile stability PSI functions
        //         based on Van Ulden and Holtslag (1985) are substituted for
        //         later formulations used with the COARE module, and temperatures
        //         used for surface layer parameters are obtained from either the
        //         nearest surface station temperature or prognostic model 2D
        //         temperatures (if ITPROG=2).

        private int m_ICOARE = 10;


        /// <summary>
        /// 浅水区长度度尺度，单位：km
        /// </summary>
        private double m_DSHELF = 0.0;

        /// <summary>
        /// 海水暖层计算
        /// 1: on - 0: off (must be off if SST measured with           IR radiometer)
        /// </summary>
        private int m_IWARM = 0;
        /// <summary>
        ///海水冷层计算
        /// 1: on - 0: off (must be off if SST measured with           IR radiometer)
        /// </summary>
        private int m_ICOOL = 0;




        # region 属性


        public int ICOARE
        {
            get { return m_ICOARE; }
            set { m_ICOARE = value; }
        }

        public double DSHELF
        {
            get { return m_DSHELF; }
            set { m_DSHELF = value; }
        }

        public int IWARM
        {
            get { return m_IWARM; }
            set { m_IWARM = value; }
        }

        public int ICOOL
        {
            get { return m_ICOOL; }
            set { m_ICOOL = value; }
        }




        # endregion



        #region IFileFrag 成员

        public string WriteToString()
        {
            string ResultStr = "", TempStr;
            string END = "\r\n";

            TempStr = "OVERWATER SURFACE FLUXES METHOD and PARAMETERS" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ICOARE", ICOARE.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("DSHELF", DSHELF.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("IWARM", IWARM.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ICOOL", ICOOL.ToString());
            ResultStr += TempStr;

            return ResultStr;


            //throw new NotImplementedException();
        }

        public void ReadFromDic(ref Dictionary<string, string> dic)
        {
            throw new NotImplementedException();
        }

        #endregion
        public void ReadFromGroup(Dictionary<string, string> dic)
        {
            foreach (KeyValuePair<string, string> m_dic in dic)
            {
                if (m_dic.Key == "ICOARE")
                {
                    this.ICOARE = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "DSHELF")
                {
                    this.DSHELF = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "IWARM")
                {
                    this.IWARM = Convert.ToInt32(m_dic.Value);
                }

                if (m_dic.Key == "ICOOL")
                {
                    this.ICOOL = Convert.ToInt32(m_dic.Value);
                }

            }
        }


    }


    public class CMetTemperatureRH 
    {
       

        /// <summary>
        /// 3D相对湿度场来源
        /// 0 =来自 SURF.DAT  (only if NOOBS = 0,1)
        /// 1 =使用预测场  (only if NOOBS = 0,1,2
        /// </summary>
        private int m_IRHPROG = 0;




        /// <summary>
        /// 3D温度场来源
        /// 0 =来自 SURF.DAT  (only if NOOBS = 0,1)
        /// 1 =地面使用地面气象，探空使用mm5 (only if NOOBS = 0,1)
        /// 2=地面和探空都使用mm5(only if NOOBS = 0,1,2)
        /// </summary>
        private int m_ITPROG = 0;

        /// <summary>
        /// 内插类型,(1 = 1/R ; 2 = 1/R**2)
        /// </summary>
        private int m_IRAD = 1;

        /// <summary>
        /// 温度内插的影响半径。单位：km
        /// </summary>
        private double m_TRADKM = 500.0;



        /// <summary>
        /// 计算温度内插最多的气象站
        /// </summary>
        private int m_NUMTS = 5;



        /// <summary>
        /// 温度的空间平均,(0=no, 1=yes)
        /// </summary>
        private int m_IAVET = 1;



        /// <summary>
        /// 海面上混合层以下温度梯度的默认递减率，单位：K/m
        /// </summary>
        private double m_TGDEFB = -0.0098;


        /// <summary>
        /// 海面上混合层以上温度梯度的默认递减率，单位：K/m
        /// </summary>
        private double m_TGDEFA = -0.0045;


        /// <summary>
        /// 海水标志的土地类型起点
        /// </summary>
        private int m_JWAT1 = 99;

        /// <summary>
        /// 海水标志的土地类型结束
        /// </summary>
        private int m_JWAT2 = 99;

        //降雨内插参数PRECIP INTERPOLATION PARAMETERS

        /// <summary>
        /// 降雨内插方法,(1=1/R,2=1/R**2,3=EXP/R**2)
        /// </summary>
        private int m_NFLAGP = 3;

        /// <summary>
        /// 内插半径，单位：km
        /// </summary>
        private double m_SIGMAP = 15;

        /// <summary>
        /// 最小的降雨量，单位：mm/hr
        /// </summary>
        private double m_CUTP = 1;




        # region 属性

        public int IRHPROG
        {
            get { return m_IRHPROG; }
            set { m_IRHPROG = value; }
        }

        private int m_CboIRHPROG = 0;
        /// <summary>
        /// 相对湿度数据设置,只与窗体表现有关，与IRHPROG组合使用
        /// </summary>
        public int CboIRHPROG
        {
            get { return m_CboIRHPROG; }
            set { m_CboIRHPROG = value; }
        }

        public int ITPROG
        {
            get { return m_ITPROG; }
            set { m_ITPROG = value; }
        }

        public int IRAD
        {
            get { return m_IRAD; }
            set { m_IRAD = value; }
        }


        public double TRADKM
        {
            get { return m_TRADKM; }
            set { m_TRADKM = value; }
        }

        public int NUMTS
        {
            get { return m_NUMTS; }
            set { m_NUMTS = value; }
        }


        public int IAVET
        {
            get { return m_IAVET; }
            set { m_IAVET = value; }
        }

        public double TGDEFB
        {
            get { return m_TGDEFB; }
            set { m_TGDEFB = value; }
        }

        public double TGDEFA
        {
            get { return m_TGDEFA; }
            set { m_TGDEFA = value; }
        }

        public int JWAT1
        {
            get { return m_JWAT1; }
            set { m_JWAT1 = value; }
        }

        public int JWAT2
        {
            get { return m_JWAT2; }
            set { m_JWAT2 = value; }
        }

        public int NFLAGP
        {
            get { return m_NFLAGP; }
            set { m_NFLAGP = value; }
        }



        public double SIGMAP
        {
            get { return m_SIGMAP; }
            set { m_SIGMAP = value; }
        }

        public double CUTP
        {
            get { return m_CUTP; }
            set { m_CUTP = value; }
        }


        #endregion



        #region IFileFrag 成员

        public string WriteToString()
        {
            string ResultStr = "", TempStr;
            string END = "\r\n";

            TempStr = "RELATIVE HUMIDITY PARAMETERS" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("IRHPROG", IRHPROG.ToString());
            ResultStr += TempStr;

            TempStr = "TEMPERATURE PARAMETERS" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("ITPROG", ITPROG.ToString());
            ResultStr += TempStr;

            TempStr = "Interpolation type" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("IRAD", IRAD.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("TRADKM", TRADKM.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("NUMTS", NUMTS.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("IAVET", IAVET.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("TGDEFB", TGDEFB.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("TGDEFA", TGDEFA.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("JWAT1", JWAT1.ToString());
            ResultStr += TempStr;


            TempStr = StrWriter.GetKeyValStr("JWAT2", JWAT2.ToString());
            ResultStr += TempStr;

            TempStr = "PRECIP INTERPOLATION PARAMETERS" + END;
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("NFLAGP", NFLAGP.ToString());
            ResultStr += TempStr;

            TempStr = StrWriter.GetKeyValStr("SIGMAP", SIGMAP.ToString());
            ResultStr += TempStr;


            TempStr = StrWriter.GetKeyValStr("CUTP", CUTP.ToString());
            ResultStr += TempStr;

            return ResultStr;


            //throw new NotImplementedException();
        }

        public void ReadFromDic(ref Dictionary<string, string> dic)
        {
            throw new NotImplementedException();
        }

        #endregion
        public void ReadFromGroup(Dictionary<string, string> dic)
        {
            foreach (KeyValuePair<string, string> m_dic in dic)
            {
                if (m_dic.Key == "IRHPROG")
                {
                    this.IRHPROG = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "ITPROG")
                {
                    this.ITPROG = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "IRAD")
                {
                    this.IRAD = Convert.ToInt32(m_dic.Value);
                }

                if (m_dic.Key == "TRADKM")
                {
                    this.TRADKM = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "NUMTS")
                {
                    this.NUMTS = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "IAVET")
                {
                    this.IAVET = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "TGDEFB")
                {
                    this.TGDEFB = Convert.ToDouble(m_dic.Value);
                }

                if (m_dic.Key == "TGDEFA")
                {
                    this.TGDEFA = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "JWAT1")
                {
                    this.JWAT1 = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "JWAT2")
                {
                    this.JWAT2 = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "NFLAGP")
                {
                    this.NFLAGP = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "SIGMAP")
                {
                    this.SIGMAP = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "CUTP")
                {
                    this.CUTP = Convert.ToDouble(m_dic.Value);
                }

            }
        }
    }





}


